# -*- coding: utf-8 -*-
"""
Created on 2021-09-26 07:21:09
---------
@summary:
---------
@author: Admin
"""

import feapder
import httpx


class Xx(feapder.AirSpider):
    def start_requests(self):
        yield feapder.Request("http://httpbin.org/ge")

    def parse(self, request, response):
        print(response)

    def xxx(self,request):
        request.headers = {'user-agent':'adfasdfasdf'}
        return request

    # def validate(self, request, response):
    #     if response.status_code!=200:
    #         raise Exception('fuck you')

    def download_midware(self, request):
        with httpx.Client(http2=True) as client:
            res = client.get(request.url)
            res.status_code=300
        return request,res

if __name__ == "__main__":
    Xx().start()